#ifndef HINETCONFIG_H
#define HINETCONFIG_H
#include <list>
#include <string>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <net/route.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <errno.h>
#include "hilog.h"

struct net_card
{
    std::string eth_name;
    int is_enabled;
};

bool get_local_ethernet(std::list<net_card> &ethernet);
bool get_local_ethernet_linkstate(const char * eth_name,int *is_link);
bool get_local_mac(char * mac, const char * eth_name="eth0");
bool get_local_ip(char *ip, const char * eth_name="eth0");
bool get_local_netmask(char *netmask, const char * eth_name="eth0");
bool get_local_gw(char* gateway);
bool get_local_dns(char* dns);

class HiNetConfig
{
public:
    HiNetConfig();    
    static void change_ip(const char* ip, const char* mask, const char* eth_name="eth0");
    static void change_gw(const char* gate, const char* eth_name="eth0");
    static void change_mac(const char * mac, const char * eth_name="eth0");
    static void change_dns(const char * dns);
};

#endif // HINETCONFIG_H
